#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTimer>
#include "CGraphics.h"
#include "CScreenManager.h"
#include "CInput.h"

namespace Ui {
    class Widget;
}

class Widget : public QWidget {
    Q_OBJECT
public:
    Widget(QWidget *parent = 0);
    ~Widget();

protected:
    void changeEvent(QEvent *e);

public slots:
    void frame();

    void keyPressEvent(QKeyEvent *e);
    void keyReleaseEvent(QKeyEvent *e);
    void mousePressEvent(QMouseEvent* e);
    void mouseReleaseEvent(QMouseEvent *e);

    bool eventFilter(QObject *o, QEvent *e);

private:
    Ui::Widget *ui;

    CInput* in;
    CGraphics* gl;
    CScreenManager *sm;
    CAudioManager *am;
    QTimer *timer;

};

#endif // WIDGET_H
